<template>
    <div>
        <h1>轮播图组件</h1>
        <div v-for="(item,index) in  banners" :key="index">
                <img :src="url+item.imgSrc" alt="">
        </div>
    </div>
</template>

<script>
    // import axios from "axios"
    export default {
        data() {
            return {
                url:"http://120.48.109.174:8081",
                banners:[],
            }
        },
        created(){
            this.getBanners()
        },
        methods:{
            getBanners(){
                this.axios.get("http://120.48.109.174:8081/home/swiper").then(res=>{
                    console.log(res);
                    let imgs = res.data.body;
                    this.banners = imgs;
                })
            }
        }
    }
</script>

<style scoped>

</style>